<%@page pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%String baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/"; %>
<!DOCTYPE html>
<html lang="en">
<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<meta name="apple-mobile-web-app-capple" content="yes">
		<meta name="apple-touch-fullscreen" content="yes">
		<%-- <link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/res/css/login.css">
		<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/res/css/style.css">
		<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/res/css/index.css"> --%>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.messager.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
		<style>
			.login_in input[type="button"], .login_in input[type="submit"] {
				width: 100%;
				height: 35px;
				font-size: 14px;
				color: #ffffff;
				text-align: center;
				line-height: 35px;
				border: 0;
				margin-top: 25px;
				background-color: #484848;
				cursor: pointer;
			}
			
			.login_in .errorTips {
				width: 215px;
				color: red;
				margin: 10px auto;
			}
			
			.login_in input[type="text"],.login_in input[type="password"]{
				text-align: center;
			}
		</style>
<jsp:include page="admin_head.jsp">
	<jsp:param value="用户信息" name="title" />
</jsp:include>
</head>
<body>
	<div class="container-fluid" >
		<div class="row">
			<div class="col-md-2"></div>
			<div class="col-md-8">
				<div class="panel panel-success" align="center">
					<div class="panel-heading">
						<h3 class="panel-title">欢迎登录教学评价系统</h3><br/>
						当前用户:${user.nickName }&nbsp;&nbsp;&nbsp;
						当前用户角色：${user.userRole }
					</div>
				</div>
				<div class="panel panel-primary">
					<div class="panel-heading"> <h3 class="panel-title">课堂评价</h3> </div>
					<div class="panel-body" >
						<form method="post" action="add_eva.action" id="form">
							<input type="hidden" name="userId" value="${user.id }">
							<input type="hidden" name="teacherId" value="${cl.teacherId }">
							<input type="hidden" name="classId" value="${cl.id }">
							<input type="hidden" name="class_count" value="${class_count }">
							<div >
								<div class="input-group">
									<span class="input-group-addon">课程名称</span> 
									<input type="text" name="className" value="${cl.name }（第${class_count }次课）" class="form-control" readonly="readonly">
								</div>
							</div>
							<div >
								<div class="input-group">
									<span class="input-group-addon">教师姓名</span> 
									<input type="text" name="teacherName" value="${cl.teacherName }" class="form-control" readonly="readonly">
								</div>
							</div>
							<c:if test="${evaItemsList ne null }">
							<c:forEach items="${evaItemsList}" var="esi" varStatus="vs">
							<div class="form-group form-inline">
								<label class="control-label col-md-3">${vs.index+1 }、${esi.name }</label>
								&nbsp; &nbsp;
								<div class="radio">
									<label>
										<input name="evaStandardItemList[${vs.index }]"  type="radio"  value="1" checked="checked">
										<span class="lbl"> 1分</span>
									</label>
								</div>
								&nbsp; &nbsp;
								<div class="radio">
									<label>
										<input name="evaStandardItemList[${vs.index }]"  type="radio"   value="2" >
										<span class="lbl"> 2分</span>
									</label>
								</div>
								&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
								<div class="radio">
									<label>
										<input name="evaStandardItemList[${vs.index }]"  type="radio"   value="3" >
										<span class="lbl"> 3分</span>
									</label>
								</div>
								&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
								<div class="radio">
									<label>
										<input name="evaStandardItemList[${vs.index }]"  type="radio"  value="4" >
										<span class="lbl"> 4分</span>
									</label>
								</div>
								&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
								<div class="radio">
									<label>
										<input name="evaStandardItemList[${vs.index }]"  type="radio"   value="5" >
										<span class="lbl"> 5分</span>
									</label>
								</div>
							</div>
							</c:forEach>
							</c:if>
							<div >
								<div class="input-group" style="display:none">
									<span class="input-group-addon">评分（必填）</span> 
									<input id="avc" name="score" type="number" value="0" class="form-control" placeholder="请输入一个正整数分数（百分制）">
								</div>
							</div>
							<div >
								<div class="input-group" >
									<span class="input-group-addon">意见与建议(可不填)</span> 
									<input type="text"  name="remark" class="form-control" placeholder="请输入意见与建议">
								</div>
							</div>
							<button style="display:none" id="kitRel" type="submit" ></button>
						</form>
						<button class="btn btn-primary"  onclick="kit()">提交</button>
						<button class="btn btn-default"  onClick="javascript :history.back(-1);">返回</button>

					</div>
				</div>
			</div>
			<div class="col-md-2"></div>
		</div>
	</div>
	<script type="text/javascript">
		function kit(){
			var length1 = $("#form input[type='radio'] ").length/5;
			var score = 0;
			for(var i=0;i<length1;i++){
				score += parseInt($('input[name="evaStandardItemList['+i+']"]:checked').val());
			}
			document.getElementById("avc").value=score;
			document.getElementById("kitRel").click();
			
		}
	</script>
</body>
</html>